<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admin', function (Blueprint $table) {
            $table->id();
            $table->string('name', 20)->default('')->comment('名称');
            $table->string('account', 20)->default('')->comment('账号');
            $table->string('password')->default('')->comment('密码');
            $table->tinyInteger('status')->default(1)->comment('是否启用');
            $table->string('last_ip', 20)->default('')->comment('最后登录IP');
            $table->dateTime('last_at')->nullable()->comment('最后登录时间');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('admin');
    }
};
